package com.shuda.business.engine.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;

import java.time.LocalDateTime;

/**
 * 数据池实体类：移除Lombok，显式提供访问器，确保跨模块调用兼容。
 * 
 * @author ink
 * @Description: 数据池实体
 * @date 2024-10-10 15:00:00
 */
@TableName("data_pool")
@Schema(name = "DataPoolEntity", description = "数据池实体")
public class DataPoolEntity {

    @TableId(type = IdType.AUTO)
    @Schema(description = "主键ID")
    private Long id;

    @Schema(description = "数据池名称")
    private String poolName;

    @Schema(description = "数据源类型(mysql,oracle,postgresql,mongodb)")
    private String dataSourceType;

    @Schema(description = "数据源连接配置(JSON格式)")
    private String dataSourceConfig;

    @Schema(description = "数据表名")
    private String tableName;

    @Schema(description = "字段映射配置(JSON格式)")
    private String fieldMapping;

    @Schema(description = "同步策略(realtime-实时,batch-批量)")
    private String syncStrategy;

    @Schema(description = "同步频率")
    private String syncFrequency;

    @Schema(description = "状态(enabled-启用,disabled-禁用)")
    private String status;

    @Schema(description = "描述信息")
    private String description;

    @Schema(description = "创建人")
    @TableField(fill = FieldFill.INSERT)
    private String createBy;

    @Schema(description = "创建时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @TableField(fill = FieldFill.INSERT)
    private LocalDateTime createTime;

    @Schema(description = "更新人")
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private String updateBy;

    @Schema(description = "更新时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private LocalDateTime updateTime;

    @Schema(description = "删除标记(0-正常,1-删除)")
    @TableLogic
    private Integer deleted;

    /**
     *
     * DataPoolEntity访问器
     * @param $params$
     * @return $returns$
     * @author ink
     * @Description: 明确提供getter/setter，避免Lombok依赖问题
     * @date 2025-11-09 10:58
     */
    public Long getId() { return id; }
    public void setId(Long id) { this.id = id; }

    public String getPoolName() { return poolName; }
    public void setPoolName(String poolName) { this.poolName = poolName; }

    public String getDataSourceType() { return dataSourceType; }
    public void setDataSourceType(String dataSourceType) { this.dataSourceType = dataSourceType; }

    public String getDataSourceConfig() { return dataSourceConfig; }
    public void setDataSourceConfig(String dataSourceConfig) { this.dataSourceConfig = dataSourceConfig; }

    public String getTableName() { return tableName; }
    public void setTableName(String tableName) { this.tableName = tableName; }

    public String getFieldMapping() { return fieldMapping; }
    public void setFieldMapping(String fieldMapping) { this.fieldMapping = fieldMapping; }

    public String getSyncStrategy() { return syncStrategy; }
    public void setSyncStrategy(String syncStrategy) { this.syncStrategy = syncStrategy; }

    public String getSyncFrequency() { return syncFrequency; }
    public void setSyncFrequency(String syncFrequency) { this.syncFrequency = syncFrequency; }

    public String getStatus() { return status; }
    public void setStatus(String status) { this.status = status; }

    public String getDescription() { return description; }
    public void setDescription(String description) { this.description = description; }

    public String getCreateBy() { return createBy; }
    public void setCreateBy(String createBy) { this.createBy = createBy; }

    public LocalDateTime getCreateTime() { return createTime; }
    public void setCreateTime(LocalDateTime createTime) { this.createTime = createTime; }

    public String getUpdateBy() { return updateBy; }
    public void setUpdateBy(String updateBy) { this.updateBy = updateBy; }

    public LocalDateTime getUpdateTime() { return updateTime; }
    public void setUpdateTime(LocalDateTime updateTime) { this.updateTime = updateTime; }

    public Integer getDeleted() { return deleted; }
    public void setDeleted(Integer deleted) { this.deleted = deleted; }
}